const KoaRouter = require("@koa/router");
const { create, showAvatarImage } = require("../controller/user.controller");
const { verifyUser, handlePassword } = require("../middleware/user.middleware");

// 创建路由对象
const userRouter = new KoaRouter({ prefix: "/users" });

// 定义路由映射
// 1. 创建注册路由
userRouter.post("/", verifyUser, handlePassword, create);
// 2、为用户提供头像
userRouter.get("/avatar/:userId", showAvatarImage);

module.exports = userRouter;
